import { stringify } from 'qs';
import request from '../utils/request';

export async function queryProjectNotice() {
  return request('/api/project/notice');
}

export async function queryActivities() {
  return request('/api/activities');
}

export async function queryRule(params) {
  return request(`/api/rule?${stringify(params)}`);
}

export async function removeRule(params) {
  return request('/api/rule', {
    method: 'POST',
    body: {
      ...params,
      method: 'delete',
    },
  });
}

export async function addRule(params) {
  return request('/api/rule', {
    method: 'POST',
    body: {
      ...params,
      method: 'post',
    },
  });
}

export async function fakeSubmitForm(params) {
  return request('/api/forms', {
    method: 'POST',
    body: params,
  });
}

export async function fakeChartData() {
  return request('/api/fake_chart_data');
}

export async function queryTags() {
  return request('/api/tags');
}

export async function queryBasicProfile() {
  return request('/api/profile/basic');
}

export async function queryAdvancedProfile() {
  return request('/api/profile/advanced');
}

export async function queryFakeList(params) {
  return request(`/api/fake_list?${stringify(params)}`);
}

export async function fakeAccountLogin(params) {
  return request('/api/login/account', {
    method: 'POST',
    body: params,
  });
}

export async function fakeRegister(params) {
  return request('/api/register', {
    method: 'POST',
    body: params,
  });
}

export async function queryNotices() {
  return request('/api/notices');
}

export async function getBackMobileVerCode(params) {
  return request('/yjx/v1/promoter/users/getBackMobileVerCode', {
    method: 'POST',
    body: params,
  });
}

export async function checkBalkMobileCode(params) {
  return request('/yjx/v1/promoter/users/checkBalkMobileCode', {
    method: 'POST',
    body: params,
  });
}

export async function middleStageLogin(params) {
  return request('/yjx/v1/company/users/middleStageLogin', {
    method: 'POST',
    body: params,
  });
}


export async function getPromoCodeList(params) {
  return request('/yjx/v1/promoter/promoter/getPromoCodeList', {
    method: 'POST',
    body: params,
  });
}

export async function createPromoCode(params) {
  return request('/yjx/v1/promoter/promoter/createPromoCode', {
    method: 'POST',
    body: params,
  });
}

export async function getPromoCodeRewardList(params) {
  return request('/yjx/v1/promoter/promoter/getPromoCodeRewardList', {
    method: 'POST',
    body: params,
  });
}

export async function deleteUserInfo(params) {
  return request('/yjx/v1/promoter/users/deleteUserInfo', {
    method: 'POST',
    body: params,
  });
}

export async function getCoopActInfoList(params) {
  return request('/yjx/v1/company/company/getCoopActInfoList', {
    method: 'POST',
    body: params,
  });
}

export async function getYjxOrgUserInfoList(params) {
  return request('/yjx/v1/company/company/getYjxOrgUserInfoList', {
    method: 'POST',
    body: params,
  });
}

export async function addYjxCoopUserInfo(params) {
  return request('/yjx/v1/company/company/addYjxCoopUserInfo', {
    method: 'POST',
    body: params,
  });
}


export async function removeYjxCoopUser(params) {
  return request('/yjx/v1/company/company/removeYjxCoopUser', {
    method: 'POST',
    body: params,
  });
}

// 获取网红用户资料 LQ
export async function getWebRedUserInfo(params) {
  return request('/yjx/v1/company/company/getRedWedUserInfo', {
    method: 'POST',
    body: params,
  });
}

// 新增网红平台资料 LQ
export async function addUserPlat(params) {
  return request('/yjx/v1/company/company/addUserPlat', {
    method: 'POST',
    body: params,
  });
}
// 编辑平台资料 LQ
export async function editPlat(params) {
  return request('/yjx/v1/company/company/editPlat', {
    method: 'POST',
    body: params,
  });
}


// 删除网红平台资料 LQ
export async function delUserPlat(params) {
  return request('/yjx/v1/company/company/delUserPlat', {
    method: 'POST',
    body: params,
  });
}

// 编辑网红资料 LQ
export async function editWebRedUser(params) {
  return request('/yjx/v1/company/company/editWebRedUser', {
    method: 'POST',
    body: params,
  });
}

// 获取单个平台资料 用于编辑 LQ
export async function getPlatInfo(params) {
  return request('/yjx/v1/company/company/getPlatInfo', {
    method: 'POST',
    body: params,
  });
}

// 获取网红公司下活动作品列表
export async function pageGetActPrd(params) {
  return request('/yjx/v1/company/company/pageGetActPrd', {
    method: 'POST',
    body: params,
  });
}






